<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Models\UserCouponRecord;

class Coupon extends Model
{
    //优惠券
    protected $table = 'coupon';

    public $timestamps = true;

    //關聯門店
    public function store(){
        return $this->belongsTo(Store::class,'store_id','id');
    }

    //關聯我的優惠券
    public function my_coupon(){
        //return $this->belongsTo(UserCoupon::class,'coupon_id','coupon_id');
        return $this->belongsTo(UserCouponRecord::class,'coupon_id','coupon_id');
    }
}
